int ice_boot_main()
{
    int num;
    // unsigned char buf[2480];
    #ifdef MMU_ON
    mmu_init();
    #endif
    led_init();
    button_init();
    init_irq();
    uart_init();
    //dma_init();
    //dma_start();
    //lcd_init();
    //lcd_test();
    ts_init();
    dm9000_init();

/*
    nand_erase(64*5+1);
    buf[0] = 99;
    NF_WritePage(64*5+1, buf);
    buf[0] = 9;
    NF_PageRead(64*5+1, buf);
    if(buf[0] = 99) {
        led_off();
    }
*/
    while(1) {
    	printf("\n\r***************************************\n\r");
    	printf("*****************IceBoot*****************\n\r");
    	printf("1:Send the ARP to get the host's MAC address\n\r");
    	printf("2:Download Linux Kernel from TFTP Server\n\r");
    	printf("3:Boot Linux from SDRAM\n\r");
    	printf("Plese Select:");
    	
    	scanf("%d",&num);

        switch (num) {
            case 1:
            arp_request();
            break;
            
            case 2:
            tftp_send_request("zImage");
            break;
            
            case 3:
            boot_linux();
            break;
            
            default:
                printf("Error: wrong selection!\n\r");
            break;	
        }
    }
    return 0;
}

